//
//  UILabel+QKLabel.m
//  QKWeibo-OC
//
//  Created by iMac_Kurt on 16/8/12.
//  Copyright © 2016年 Kurt_Qi. All rights reserved.
//

#import "UILabel+QKLabel.h"

@implementation UILabel (QKLabel)
/// 快速创建Label
///
/// @param text      内容
/// @param textColor 文字颜色
/// @param fontSize  文字大小
///
/// @return UILabel
+ (instancetype)labelWithText:(NSString *)text color:(UIColor *)textColor fontSize:(CGFloat)fontSize {
    UILabel *label = [[UILabel alloc] init];
    label.text = text;
    label.textColor = textColor;
    label.font = [UIFont systemFontOfSize:fontSize];
    label.numberOfLines = 0;
    label.textAlignment = NSTextAlignmentCenter;
    
    return label;
}
/// 快速创建Label - 自适应屏幕宽度
///
/// @param text     内容
/// @param fontSize 文字大小
/// @param inset    屏幕边距
///
/// @return UILabel
+ (instancetype)labelWithText:(NSString *)text fontSize:(CGFloat)fontSize screenInset:(CGFloat)inset {
    UILabel *label = [[UILabel alloc] init];
    label.text = text;
    label.textColor = [UIColor darkGrayColor];
    label.font = [UIFont systemFontOfSize:fontSize];
    label.numberOfLines = 0;
    label.textAlignment = NSTextAlignmentLeft;
    
    label.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 2 * inset;
    
    return label;
}
@end
